package
        com.zzc.sale.controller;

import com.hos.entity.stock.Medicines;
import com.zzc.sale.service.MedicinesService;
import com.zzc.sale.service.ProducerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author：xIAO_ZHOU_TX
 * @date：Created in 2023/12/14 15:46
 * @description：
 * @modified By：
 * @version:
 */
@RequestMapping("/sale/erp/medicines")
@RestController
public class MedicinesController {

    @Resource
    private MedicinesService medicinesService;

    /**
     * 根据id查询并减少库存
     *
     * @param medicines 药品列表
     */
    @PostMapping("reducePharmaceuticalById")
    public boolean reducePharmaceuticalById(@RequestBody Medicines medicines) {
        System.out.println(medicines);
        return medicinesService.reducePharmaceuticalById(medicines);
    }
    /**
     * 根据id查询并添加库存
     *
     * @param medicines 药品列表
     */
    @PostMapping("addPharmaceuticalById")
    public boolean addPharmaceuticalById(@RequestBody Medicines medicines){
        return medicinesService.addPharmaceuticalById(medicines);
    }
}